<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_creditchange/index/'),
		array('title'=>'我的发布','icon'=>'icon-map','action'=>'jy_creditchange/mygoods/'),
		array('title'=>'我参与的','icon'=>'icon-map','action'=>'jy_creditchange/order/'),
		array('title'=>'我的','icon'=>'icon-wo1','action'=>'jy_creditchange/home/'),
	);
	$hdps =array(
		array('title'=>'幻灯片','picurl'=>'../addons/jy_creditchange/resource/img/hdp01.jpg','action'=>'jy_videoshop/index/'),
	);
	$plugins =$this->plugins();
	$return['item']=$this->plugin_setting('basic');
	$return['item']['hdps']=$return['item']['hdps']?$return['item']['hdps']:$hdps;
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'string','title'=>'应用标题','name'=>'title','help'=>'建议18个字以内！'),
					array('type'=>'text','title'=>'描述','name'=>'desc','help'=>'建议68个字以内！'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo','help'=>'建议尺寸：高68px*宽120px'),
					array('type'=>'choose','title'=>'管理员UID','name'=>'adminuid','action'=>'core/member.get_member/','choose_title'=>'选择会员','help'=>'便于接收平台高级消息！'),
					//array('type'=>'unitstring','unit'=>'%','title'=>'提现手续费','name'=>'rate'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image','help'=>'建议尺寸：高320px*宽640px'),
				)
			),
			array(
				'title'=>'回购设置',
				'list'=>array(
					array('type'=>'switch','title'=>'开启回购','name'=>'is_gou','help'=>'开启回购后，商品竞价失败后，可以支持系统回购！'),
				)
			),
			array(
				'title'=>'幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'hdps',
							'add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>'建议尺寸：高360px*宽640px'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								)
						)
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
							array('type'=>'switch','title'=>'强制显示本菜单','name'=>'is_myfooternav','help'=>'开启后，访问本插件的页面时，底部菜单不会跟随当前场景体的底部菜单！'),
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','from'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
			array(
				'title'=>'页面UI',
				'list'=>array(
					array('type'=>'colorpicker','title'=>'项目顶部颜色','name'=>'r_color','help'=>'自定义系统颜色系，默认： red'),
					array('type'=>'image','title'=>'会员顶部图片','name'=>'h_img','help'=>'建议尺寸：高360px*宽640px'),
					array('type'=>'colorpicker','title'=>'会员顶部颜色','name'=>'h_color','help'=>'自定义系统颜色系，默认： red'),
					array('type'=>'image','title'=>'群列表顶部图片','name'=>'o_img','help'=>'建议尺寸：高360px*宽640px'),
					array('type'=>'colorpicker','title'=>'群列表顶部颜色','name'=>'o_color','help'=>'自定义系统颜色系，默认： red'),
					array('type'=>'image','title'=>'发红包弹窗背景图','name'=>'o_hongbao','help'=>'发红包弹窗背景图，建议尺寸：高520px*宽360px'),
				)
			)
		),
	);
	$credit_types=$this->credit_types;
	foreach($credit_types as $k=>$cv){
		$title=credit_types(true)[$k];
		$htmls['edits'][1]['list'][]=array('type'=>'unitstring','unit'=>'%','title'=>$title.'回购比例','name'=>'gourate'.$k);
	}
	$return['htmls']=$htmls;
	exi($return);
}